﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;

namespace GNSWebSite.Settings
{
    /// <summary>
    /// For mail options
    /// </summary>
    public class MailSettings
    {
        private static XDocument _doc = XDocument.Load(HttpContext.Current.Server.MapPath("~/Settings/GnsSettings.xml"));
        /// <summary>
        /// Default radius to search events in kilomiters
        /// </summary>
        public static bool UseSSL
        {
            get
            {
                return
                    Convert.ToBoolean(
                    _doc.Descendants("gnssettings").Elements("mail").FirstOrDefault().Element(
                            "usemailssl").Attribute("value").Value);
            }
        }
    }
}
